<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>helloworld</title>
</head>

<body>

    <div id="app">
        <h2>hello,{{name}}</h2>
    </div>
    <script src="./node_modules/vue/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                name: '小明'
            }
        });
    </script>


    <h2>双向绑定</h2>

    <div id="doubleApp">
        {{number}}
        <input type="number" v-model="number" />
        <!-- v-on:click="number++" -->
        <button  v-on:click="add">+</button>
    </div>
    <script>
        var doubleApp = new Vue({
            el: '#doubleApp',
            data: {
                number: 0
            },
            methods: {
                add:function(){
                    this.number++;
                }    
            }
        })
    </script>

</body>

</html>